home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 242
/
242.d81
/
t.packer 1.2
< prev
next >
Wrap
Text File
|
2022-08-26
|
7KB
|
243 lines
u
S T A R P A C K E R 1 . 2
Program and Text by Lee Novak
What a packer does is take a file
and compress the information in it,
usually resulting in a smaller file.
This smaller file, when later RUN,
automatically "unpacks" itself back
to its original state.
The advantages of packing a
program is twofold. The packed file
takes up less room on a disk. Since
small files load faster than large
ones, your waiting time is lessened.
LOADSTAR has generally used three
compressor programs in the past, each
with its pros and cons. Let's check
out these programs...
SUPERCRUNCH is a commercially
available packer, meaning it cannot
be published on LOADSTAR. It has the
fastest packing and unpacking times,
but doesn't compress files very well.
Its biggest flaw is that is doesn't
alter the start-of-variables pointer,
causing some programs to crash.
BIT IMPLODER is a PD cruncher
that LOADSTAR published on LS #137.
It has the best compression and a
fancy packing screen. But, a maximum
file size of 120 blocks limits what
you can do with this packer. LOADSTAR
may never use BIT IMPLODER again. The
use of illegal op-codes makes it not
compatible with the SuperCPU!
SHIELD PACKER is a PD cruncher
that LOADSTAR published on LS #147.
It has second-to-best compression and
can handle files large as 241 blocks!
It's the hardest one to use: Half the
time I can't get programs to unpack
without locking up the computer. The
screen also fills with garbage during
unpacking, giving your program an
unprofessional appearance.
[DRUM ROLL, PLEASE...]
[{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}]
STAR PACKER is my entry into the
shrinking world of data compression.
The packer resembles the BIT IMPLODER
somewhat in style, especially on the
main packing screen. It can pack both
regular BASIC and STAR LINKED files
up to 51K (205 blocks) in size. These
programs unpack very quickly without
messing with the screen in any way.
Using your new compressor is
incredibly easy. When RUN, it gives
you four options:
F1: Select Source Drive
F3: Select Target Drive
F5: Select File for Compression
B: Quit to BASIC
Your unpacked file file loads
from one drive and the packed version
saves to another. F1 and F3 cycle
through active drives only. It's okay
if they're the same.
This program has been OPTIMIZED
for the SuperCPU, ensuring you get
the fastest possible pack times. The
optimization mode is turned OFF when
you return to BASIC by pressing "B".
A file requestor pops up after
pressing F5. While any program up to
51K (205 blocks) can be selected, it
must both LOAD and RUN from the
standard BASIC address of 2049.
Raised-BASIC programs won't work.
To get around this problem, you could
use STAR LINKER V3 (on issue #174) to
handle the raising of BASIC, and then
that linked program could be packed.
After you select a file, you then
choose the CRUNCH MODE from 1-9. The
higher the number, the better the job
the program does of packing, and the
longer it takes to do it. Programmers
are encouraged to use "9" for files
they are sending to LOADSTAR.
STAR PACKER then loads your file
and begins the packing process. The
program tells you the initial size of
the file in bytes and disk blocks.
It also keeps a running tally of the
new size (which includes the unpacker
code it has to add), the types of
compression applied, the bytes saved
by each of these methods, the elapsed
time, the bytes remaining to check,
and a gauge showing the same thing.
If you've seen the BIT IMPLODER
in action, you can see the impact it
has had on my program. This fancy
display only adds a few seconds to
the total packing time. Pressing STOP
would abort the packing process.
After packing, the program asks
for the save name. If the entered
name already exists, you're told this
and can choose again. If any other
disk error occurs, you've lost your
chance to save the compressed file!
You should be able to save to
another partition or subdirectory on
CMD devices by including the proper
prefix to the filename, just like you
would if saving from direct mode. See
your drive's manual for details.
You can skip the saving portion
by pressing F7. This way, you can
load and pack files just to see how
they come out. But don't press F7
unless you mean it!
After saving, you're allowed to
go back to the main menu, return to
BASIC, or take a peek at the packing
statistics again. That's all!
[...BUT HOW GOOD IS IT?]
[{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}{SHIFT-*}]
Let's see how STAR PACKER fares
against the competition. I've chosen
13 files from LOADSTAR's past for
this first test: compression quality.
PROGRAM LENGTHS: Bit Imploder{SHIFT-*}N
(in blocks) Shield Packer{SHIFT-*}N {SHIFT--}
Star Packer{SHIFT-*}N {SHIFT--} {SHIFT--}
Supercrunch{SHIFT-*}N {SHIFT--} {SHIFT--} {SHIFT--}
Uncompressed{SHIFT-*}N {SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--}
{SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--}
B.STAR TRIP 22 20 17 17 17
B.MONDO WORDO 38 32 27 27 26
B.TEXT CHARTER 39 25 22 22 21
B.INVEST 40 33 26 26 24
B.COUPON MAKER 46 36 28 27 26
B.SOLVE MYSCHESS 46 30 25 24 24
B.CRYPTO RESULTS 64 47 40 39 37
FIREFIGHTER 65 52 46 47 45
B.FOX & HOUNDS 91 63 50 49 46
MUSEUM 120 100 77 74 70
QUICKSMITH 136 109 97 94 -
B.RAPTOR.MOV 156 158 160 158 -
B.MOUSE 2.1 MAKER 199 168 111 110 -
See how close STAR PACKER comes
to SHIELD PACKER's efficiency? The
BIT IMPLODER rules the chart until
it's forced to bow out at 121 blocks.
And well, SUPERCRUNCH is the obvious
loser in this competition.
I didn't expect B.RAPTOR.MOV to
get any smaller since it was already
packed. It was fun to try, though.
Compression quality doesn't mean
a lot unless you allow the computer
the time to compress the file! This
second test is the time taken to pack
files of 39, 65, 91, and 120 blocks,
with and without the SuperCPU.
PACKING TIMES: Supercrunch{SHIFT-*}N
(min/sec) Star Packer{SHIFT-*}N {SHIFT--}
Bit Imploder{SHIFT-*}N {SHIFT--} {SHIFT--}
Shield Packer{SHIFT-*}N {SHIFT--} {SHIFT--} {SHIFT--}
{SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--}
-STOCK CPU- {SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--}
text charter 4:33 3:17 3:20 0:27
firefighter 18:14 12:28 12:48 1:02
fox & hounds 21:55 16:34 16:30 1:05
museum 41:15 32:03 31:45 1:30
{SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--}
-SUPER CPU- {SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--}
text charter 0:15 0:11 0:09 0:03
firefighter 1:00 0:39 0:37 0:06
fox & hounds 1:18 0:53 0:47 0:06
museum 2:23 1:40 1:31 0:11
{SHIFT--} {SHIFT--} {SHIFT--} {SHIFT--}
SCPU speed-up: 17x 19x 21x 9x
SUPERCRUNCH wins the speed test,
hands down! The other three packers
take a lot more time, but manage to
squeeze out a lot more bytes, too.
The last statistic to throw at
you is the speed at which these files
unpack at RUN-time. The following are
crude estimates of the time needed to
unpack an originally 136-block file:
Supercrunch 1.5 secs (91 blks/sec)
Star Packer 2.0 secs (68 blks/sec)
Bit Imploder 5.0 secs (27 blks/sec)
Shield Packer 6.0 secs (23 blks/sec)
Remember, this is for unpacking
the file only. STAR LINKED files need
to unlink afterwards, which can take
up to eight seconds on a stock CPU.
LN